<template>
  <div id="app">
    <router-view />
  </div>
</template>

<script setup>
import { onMounted } from 'vue'
import { useAuthStore } from '@/stores/auth'
import { useCartStore } from '@/stores/cart'

const authStore = useAuthStore()
const cartStore = useCartStore()

onMounted(() => {
  // 初始化认证状态
  authStore.initAuth()

  // 初始化购物车
  cartStore.initCart()
})
</script>

<style>
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #ffffff;
  color: #333333;
  line-height: 1.6;
}

#app {
  min-height: 100vh;
}

/* 全局样式 */
.el-button {
  transition: all 0.3s ease;
}

.el-card {
  border-radius: 8px;
  border: 1px solid #e4e7ed;
}

.el-card:hover {
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
}
</style>